<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link href="/lib/layui/css/layui.css" rel="stylesheet"/>
    <link href="/css/common.css" rel="stylesheet"/>
    <title>编辑字典值</title>
</head>
<body>
<div class="layui-fluid">
    <div class="layui-row layui-col-space10">
        <div class="layui-card">
            <div class="layui-card-body">
                <form class="layui-form">
                    <div class="layui-form-item">
                        <label class="layui-form-label"><span class="layui-color-red">*</span>&nbsp;字典码：</label>
                        <div class="layui-input-block">
                            <input class="layui-input" type="text" name="dictCode" lay-verify="required" placeholder="请输入字典码" autocomplete="off" readonly>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label"><span class="layui-color-red">*</span>&nbsp;字典键：</label>
                        <div class="layui-input-block">
                            <input class="layui-input" type="text" name="name" lay-verify="required" placeholder="请输入字典键" autocomplete="off" maxlength="100">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label"><span class="layui-color-red">*</span>&nbsp;字典值：</label>
                        <div class="layui-input-block">
                            <input class="layui-input" type="text" name="value" lay-verify="required" placeholder="请输入字典值" autocomplete="off" maxlength="100">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-input-block">
                            <input type="hidden" name="id">
                            <button class="layui-btn" lay-filter="submitBtn" lay-submit data-url="/system/dictcontent/saveOrUpdate.do">提交</button>
                            <button class="layui-btn layui-hide" type="button" id="submit">提交</button>
                            <button class="layui-btn layui-btn-primary" type="button" id="cancel">取消</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
<script src="/lib/layui/layui.all.js" charset="utf-8"></script>
<script src="/script/common.js" charset="utf-8"></script>
<script>
    var id = getRequestParams('id');
    var dictCode = getRequestParams('dictCode');

    layui.use(['baseUtil'], function () {
        var $ = layui.jquery,
            baseUtil = layui.baseUtil;

        if (isBlank(id)) {
            $('input[name=dictCode]').val(dictCode);
        } else {
            var url = '/system/dictcontent/findOne.do';
            var params = { id: id };
            var cols = [
                { type: 'input', name: 'id' },
                { type: 'input', name: 'dictCode' },
                { type: 'input', name: 'name' },
                { type: 'input', name: 'value' }
            ];
            baseUtil.initFormData(url, params, cols);
        }
    });
</script>
</body>
</html>
